﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HROReporting.Services.Interfaces;
using HROReporting.Services.Messaging.NFCDeviceService;
using HROReporting.Model.NFCDevices;
using HROReporting.Infrastructure.UnitOfWork;
using HROReporting.Services.Mapping;

namespace HROReporting.Services.Implementations
{
    public class NFCDeviceService : INFCDeviceService
    {
        private readonly INFCDeviceRepository _nfcDeviceRepository;
        private readonly IUnitOfWork _uow;

        public NFCDeviceService(INFCDeviceRepository nfcDeviceRepository, IUnitOfWork uow)
        {
            _nfcDeviceRepository = nfcDeviceRepository;
            _uow = uow;
        }

        public GetNFCDeviceByResponse GetNFCDeviceByDeviceSerial(GetNFCDeviceByRequest request)
        {
            GetNFCDeviceByResponse response = new GetNFCDeviceByResponse();

            response.NFCDevice = _nfcDeviceRepository.GetNFCDeviceByDeviceSerial(request.NFCDeviceSerial);

            return response;
        }

        public GetAllNFCDevicesResponse GetAllNFCDevices()
        {
            GetAllNFCDevicesResponse response = new GetAllNFCDevicesResponse();

            response.NFCDevices = _nfcDeviceRepository.FindAll();

            return response;
        }
    }
}
